from django.urls import path

from . import views

urlpatterns = [
    # 判断用户名是否重复
    # /usernames/itcast/count/
    # path('usernames/<'匹配用户名的路由转换器:变量名'>/count/', views.UsernameCountView.as_view()),
    path('usernames/<username:username>/count/', views.UsernameCountView.as_view()),

    # 判断手机号码是否重复
    # /mobiles/mobile/count/
    path('mobiles/<mobile:mobile>/count/', views.MobileCountView.as_view()),

    # 用户注册
    path('register/', views.RegisterView.as_view()),

    # 用户登录
    path('login/', views.LoginView.as_view()),

    # 退出登录
    path('logout/', views.LogoutView.as_view()),

    # 用户中心
    path('info/', views.UserInfoView.as_view()),

    # 添加邮箱
    path('emails/', views.EmailView.as_view()),

    # 验证邮箱激活 /emails/verification/
    path('emails/verification/', views.EmailActiveView.as_view()),

    # 新增地址
    path('addresses/create/', views.CreateAddressView.as_view()),

    # 查询收货地址
    path('addresses/', views.AddressView.as_view()),

    # /addresses/(?P<address_id>\d+)/
    path('addresses/<int:address_id>/', views.UpdateDestoryAddressView.as_view()),

    # 设置默认地址/addresses/(?P<address_id>\d+)/default/
    path('addresses/<int:address_id>/default/', views.DefaultAddressView.as_view()),

    #设置地址标题/addresses/(?P<address_id>\d+)/title/
    path('addresses/<int:address_id>/title/',views.UpdateTileAddressView.as_view()),

    #修改密码
    path('password/',views.ChangePasswordView.as_view()),

]
